package com.easy.service.impl;

import com.easy.bean.User;
import com.easy.dao.UserDao;
import com.easy.service.IShoppingLoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ShoppingLoginServiceImpl implements IShoppingLoginService {

    @Autowired
    UserDao userDao;

    @Override
    public User dologin(User user) {
        User userdata= userDao.getUserByUsername(user.getUsername());
        if(userdata!=null&&user.getPassword().equals(userdata.getPassword())){
            return userdata;
        }
        return null;
    }
}
